# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.InstanceGroupManagerInstanceLifecyclePolicy do
  @moduledoc """


  ## Attributes

  *   `defaultActionOnFailure` (*type:* `String.t`, *default:* `nil`) - The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM. 
  *   `forceUpdateOnRepair` (*type:* `String.t`, *default:* `nil`) - A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair. 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :defaultActionOnFailure => String.t() | nil,
          :forceUpdateOnRepair => String.t() | nil
        }

  field(:defaultActionOnFailure)
  field(:forceUpdateOnRepair)
end

defimpl Poison.Decoder,
  for: GoogleApi.Compute.V1.Model.InstanceGroupManagerInstanceLifecyclePolicy do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.InstanceGroupManagerInstanceLifecyclePolicy.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Compute.V1.Model.InstanceGroupManagerInstanceLifecyclePolicy do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
